﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using TotalSystems.Web.Services.Store;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using TotalSystems.DataAccess;
using TotalSystems.Store.Views.BaseInfo;
using System.ServiceModel.DomainServices.Client;
using GalaSoft.MvvmLight;
using TotalSystems.Core.Infrastructure;

namespace TotalSystems.Store.ViewModels.BaseInfo
{
    public class Store_VM : ViewModelBase
    {
        StoreContext _Context = new StoreContext();
        #region Constractor

        public Store_VM()
        {
            _Context.Load(_Context.GetStoreQuery(), OnGetStoreQueryCompleted, null);
        }

        #endregion 

        //BaseDefenitionTreeViewBuilder<STR_Store> TreeViewBuilder = new BaseDefenitionTreeViewBuilder<STR_Store>();

        #region Defenition



        #endregion

        #region Propertis

        private ObservableCollection<STR_Store> _StoreEntitys;
        public ObservableCollection<STR_Store> StoreEntitys
        {
            get { return _StoreEntitys; }
            set
            {
                _StoreEntitys = value;
                RaisePropertyChanged("StoreEntitys");
            }
        }

        #endregion

        #region 

        private void  OnGetStoreQueryCompleted(LoadOperation<STR_Store> op)
        {
            StoreEntitys = new ObservableCollection<STR_Store>(_Context.STR_Stores);
        }

        #endregion
    }
}
